import { useState } from "react";
import Child from "./Child";
import { countCtx, helloCtx } from "./count";

const Father = () => {
	const [count, setCount] = useState(0);
	function log() {
		console.log(count);
	}
	return (
		<div>
			<countCtx.Provider value={count}>
				<helloCtx.Provider value={log}>
					<div onClick={() => setCount(count + 1)}>father</div>
					<Child />
				</helloCtx.Provider>
			</countCtx.Provider>
		</div>
	);
};

export default Father;